<?php

// dbaSearch for MySQL => 2.23

class dbaSearch {

 function dbaSearch (&$dba) {
   $this->dba = &$dba;
 }

 function getArticle ($id){
   $check = $this->dba->query("select id,name,orderno,short_descr,display_url As tpl,amount As price,kg,packet,listimg_url,listimg_width,listimg_height,listimg_type,infoimg_url,infoimg_width,infoimg_height,infoimg_type from ".$this->dba->tableforwarder."_shopArt where id=$id;");
   return $this->dba->fetch_row_Array();
 }

 function search_fulltext($searcharray,$lang){
   for ($i=0;$i<count($searcharray);$i++)
     $searchstr .= ($i!=0)?" ".$searcharray[$i]:$searcharray[$i];
   $query  = "select id As subject_id,MATCH (name,short_descr,long_descr) AGAINST (".$this->dba->quote($searchstr).") AS score";
   $query .= " from ".$this->dba->tableforwarder."_shopArt";
   $query .= " where MATCH (name,short_descr,long_descr) AGAINST (".$this->dba->quote($searchstr).") order by score;";
   $check  = $this->dba->query($query);
   $ft_result = $this->dba->fetch_rows_Array();
   return $ft_result;
 }

}
?>